import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// 导入全局样式表
import './assets/CSS/global.css'
import axios from 'axios'
import JsonExcel from 'vue-json-excel'


Vue.config.productionTip = false
Vue.use(ElementUI)
Vue.component('downloadExcel', JsonExcel)

// 配置请的跟路径
axios.defaults.baseURL = `http://47.242.85.125`
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
axios.defaults.headers.post['Content-Type'] = 'application/json; charset=UTF-8';
// 添加 请求头 和 进度条 NProgress.start()
axios.interceptors.request.use(config => {
  // 添加请求头
  config.headers.Authorization = window.sessionStorage.getItem('token')

  return config
})
axios.interceptors.response.use(config => {
  return config
})
Vue.prototype.$http = axios



new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
